package com.controller;


import com.common.api.ApiResult;
import com.dto.FlyRectangleParam;
import com.entity.Securityrestriction;
import com.service.DroneService;
import com.service.ISecurityrestrictionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-07-08
 */
@RestController
@RequestMapping("/security")
public class SecurityrestrictionController {
    @Autowired
    private ISecurityrestrictionService iSecurityrestrictionService;

    @PostMapping("/setSecurityRestriction")
    public ApiResult setSecurityRestriction(@RequestBody Securityrestriction securityrestriction) throws IOException, InterruptedException {
        iSecurityrestrictionService.saveOrUpdate(securityrestriction);
        return ApiResult.success("防护策略已更新");
    }
    @GetMapping("/getSecurityRestriction")
    public ApiResult getSecurityRestriction() throws IOException, InterruptedException {
        return ApiResult.success( iSecurityrestrictionService.getById(1));

    }
}
